package com.jdz.controller.backend;

import com.jdz.common.Const;
import com.jdz.common.ServerResponse;
import com.jdz.service.IProjectDetailsRaceTypeSamsaraService;
import com.jdz.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
@RequestMapping("/manage/projectdetailsraceTypesamsara")
public class ProjectDetailsRaceTypeSamsaraManageControoller {


    @Autowired
    IProjectDetailsRaceTypeSamsaraService iProjectDetailsRaceTypeSamsaraService;


    /**
     * 查看本项目评审审核情况和票数
     * @param projectno
     * @return
     */
    @RequestMapping(value = "list.do",method = RequestMethod.POST)
    @ResponseBody
    public ServerResponse list(Integer projectno) {
        return iProjectDetailsRaceTypeSamsaraService.list(projectno);
    }



    @RequestMapping(value = "examine.do",method = RequestMethod.POST)
    @ResponseBody
    public ServerResponse Review(HttpSession session, @RequestParam(value = "projectnoList[]") List<Integer> projectnoList,
                                 @RequestParam(value = "reviewnotes",required = false) Integer reviewnotes,@RequestParam(value = "examineResult",required = false)String result,
                                 @RequestParam(value = "examinestatus",required = false)Integer examinestatus) {
        UserVo userVo = (UserVo) session.getAttribute(Const.CURRENT_USER);
        return iProjectDetailsRaceTypeSamsaraService.Review(projectnoList,userVo.getStuno(),reviewnotes,result,examinestatus);
    }

//    /**
//     * 审核
//     * @param session
//     * @param projectnoList
//     * @param examinestatus
//     * @param examineResult
//     * @return
//     */
//    @RequestMapping(value = "examine.do",method = RequestMethod.POST)
//    @ResponseBody
//    public ServerResponse Examine(HttpSession session,@RequestParam(value = "projectnoList[]") List<Integer> projectnoList,
// @RequestParam(value = "examinestatus")Integer examinestatus,@RequestParam(value = "examineResult",required = false) String examineResult,
// @RequestParam(value = "reviewnotes",required = false) String reviewnotes) {
//        UserVo userVo = (UserVo) session.getAttribute(Const.CURRENT_USER);
//        return iProjectDetailsRaceTypeSamsaraService.Examine(projectnoList,userVo.getStuname(),examinestatus,examineResult,reviewnotes);
//    }
}
